﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Security.Cryptography.X509Certificates;
using Web.IBLL;
using Web.Model;

namespace WebAPI.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class RoomController : ControllerBase
    {
        public RoomController(IRoomBLL bLL)
        {
            BLL = bLL;
        }

        public IRoomBLL BLL { get; }
        [HttpPost]
        public Task<int> RAdd(Room r)
        {
            return BLL.RAdd(r);
        }


        [HttpGet]
        public dynamic RShow(int Pageindex, int Pagesize)
        {
            return BLL.RShow(Pageindex, Pagesize);
        }
        [HttpDelete]
        public Task<int> RDel(int Id)
        {
           return BLL.RDel(Id);
        }
        [HttpGet]
        public Room Fan(int Id)
        {
            return BLL.Fan(Id);
        }
        [HttpPost]
        public Task<int> Upd(Room r)
        {
            return BLL.Upd(r);
        }

    }
}
